package ichubconfig

import (
	"fmt"
	"gitee.com/ichub/goconfig/common/base/basedto"
	"gitee.com/ichub/goconfig/common/base/baseutils/fileutils"
)

type WebConfig struct {
	basedto.BaseEntitySingle
	RootDir string
	CfgFile string
}

func NewWebConfig() *WebConfig {
	return &WebConfig{
		CfgFile: "/config/app-%s.yml",
	}
}

func (this *WebConfig) BuildFileName(env string) string {

	this.RootDir = fileutils.FindRootDir()
	var filename = this.RootDir + fmt.Sprintf(this.CfgFile, env)

	return filename
}
